package com.xuelang.pipeline.artifact.client.resource;

import com.xuelang.pipeline.artifact.client.common.request.PageParam;
import com.xuelang.pipeline.artifact.client.common.result.ApiResult;
import com.xuelang.pipeline.artifact.client.common.result.PageRecord;
import com.xuelang.pipeline.artifact.client.resource.dto.RepositoryPackageDTO;
import com.xuelang.pipeline.artifact.client.resource.dto.RepositoryPackageQuery;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;
import java.util.List;

/**
 * 制品包服务API
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
public interface IRepositoryPackageService {

    /**
     * 查询制品包列表(有过滤条件，可以分页)
     *
     * @param dtoPageParam 查询条件
     * @return
     */
    @PostMapping(value = "/pageList", produces = "application/json;charset=utf-8")
    ApiResult<PageRecord<RepositoryPackageDTO>> pageRepositoryPackageList(@RequestBody @Valid PageParam<RepositoryPackageQuery> dtoPageParam);

    /**
     * 查询制品包列表(有过滤条件)
     *
     * @param repositoryPackageQuery 查询条件
     * @return
     */
    @PostMapping(value = "/list", produces = "application/json;charset=utf-8")
    ApiResult<List<RepositoryPackageDTO>> conditionalRepositoryPackageList(@RequestBody @Valid RepositoryPackageQuery repositoryPackageQuery);


    /**
     * 删除制品包
     *
     * @param packageUuid 制品包UUID
     * @return
     */
    @DeleteMapping(value = "/{packageUuid}", produces = "application/json;charset=utf-8")
    ApiResult<Boolean> deleteRepositoryPackage(@PathVariable("packageUuid") String packageUuid);
    /**
     * 查询制品包
     *
     * @param packageUuid 制品包UUID
     * @return
     */
    @GetMapping(value = "/{packageUuid}", produces = "application/json;charset=utf-8")
    ApiResult<RepositoryPackageDTO> queryRepositoryPackage(@PathVariable("packageUuid") String packageUuid);

}
